﻿using System;
using System.Globalization;
using System.Linq;
using System.Windows.Data;

namespace VNet.VisiSuite.VisiAdmin.Common.Converters
{
    public class MultiBoolConverter : IMultiValueConverter
    {
        public virtual object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values.Count() == 2 && values[0] is bool && values[1] is string)
            {
                return ((bool) values[0]) && ! string.IsNullOrEmpty((string) values[1]);
            }
            return false;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
